package com.joesem.sale.client.network.data

import android.os.Parcel
import android.os.Parcelable

/**
 * @Time 2023/2/20 10:15:42
 * @Description
 **/
class WorkOrderMode(
    val address: String? = null,
    val city_id: Int? = null,
    val city_name: String? = null,
    val contact_name: String? = null,
    val contact_phone: String? = null,
    val country_id: Int? = null,
    val country_name: String? = null,
    val county_id: Int? = null,
    val county_name: String? = null,
    val create_time: String? = null,
    val create_time_format: String? = null,
    val create_user_id: Int? = null,
    val description: String? = null,
    val id: Int? = null,
    val level: String? = null,
    val plan_at: String? = null,
    val province_id: Int? = null,
    val province_name: String? = null,
    val service_content: String? = null,
    val service_type: String? = null,
    val status: String? = null,
    val type: String? = null,
    val update_time: String? = null,
    val update_time_format: String? = null,
    val wo_number: String? = null,
    val customer: Customer? = null,
    val users: List<User>? = null
) {
    inner class User(
        val create_time: String? = "",
        val id: Int? = 0,
        val is_master: Int? = 0,
        val update_time: String? = "",
        val user: UserX? = UserX(),
        val user_id: Int? = 0,
        val work_order_id: Int? = 0
    )

     class UserX(
        val address: String? = "",
        val avatar: String? = "",
        val birthday: String? = "",
        val city_code: String? = "",
        val city_name: String? = "",
        val create_time: String? = "",
        val create_user: Int? = 0,
        val dept_id: Int? = 0,
        val district_code: String? = "",
        val email: String? = "",
        val gender: Int? = 0,
        val id: Int? = 0,
        val intro: String? = "",
        val level_id: Int? = 0,
        val login_num: Int? = 0,
        val login_time: Int? = 0,
        val mark: Int? = 0,
        val mobile: String? = "",
        val nickname: String? = "",
        val note: String? = "",
        val password: String? = "",
        val position_id: Int? = 0,
        val province_code: String? = "",
        val realname: String? = "",
        val salt: String? = "",
        val sort: Int? = 0,
        val status: Int? = 0,
        val update_time: String? = "",
        val update_user: Int? = 0,
        val username: String? = ""
    ):Parcelable {
         constructor(parcel: Parcel) : this(
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString(),
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString(),
             parcel.readString(),
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString(),
             parcel.readValue(Int::class.java.classLoader) as? Int,
             parcel.readString()
         ) {
         }

         override fun writeToParcel(parcel: Parcel, flags: Int) {
             parcel.writeString(address)
             parcel.writeString(avatar)
             parcel.writeString(birthday)
             parcel.writeString(city_code)
             parcel.writeString(city_name)
             parcel.writeString(create_time)
             parcel.writeValue(create_user)
             parcel.writeValue(dept_id)
             parcel.writeString(district_code)
             parcel.writeString(email)
             parcel.writeValue(gender)
             parcel.writeValue(id)
             parcel.writeString(intro)
             parcel.writeValue(level_id)
             parcel.writeValue(login_num)
             parcel.writeValue(login_time)
             parcel.writeValue(mark)
             parcel.writeString(mobile)
             parcel.writeString(nickname)
             parcel.writeString(note)
             parcel.writeString(password)
             parcel.writeValue(position_id)
             parcel.writeString(province_code)
             parcel.writeString(realname)
             parcel.writeString(salt)
             parcel.writeValue(sort)
             parcel.writeValue(status)
             parcel.writeString(update_time)
             parcel.writeValue(update_user)
             parcel.writeString(username)
         }

         override fun describeContents(): Int {
             return 0
         }

         companion object CREATOR : Parcelable.Creator<UserX> {
             override fun createFromParcel(parcel: Parcel): UserX {
                 return UserX(parcel)
             }

             override fun newArray(size: Int): Array<UserX?> {
                 return arrayOfNulls(size)
             }
         }
     }
}


